package List;

import demo1.user;

import java.util.HashSet;
import java.util.Iterator;

public class HashSetDemo2 {
    public static void main(String[] args) {
        HashSet set = new HashSet();
        set.add(new user(19, "黑熏风"));
        set.add(new user(18, "助教"));
        set.add(new user(28, "班导"));
        set.add(new user(19, "班长"));
        set.add(new user(19, "黑熏风"));
        System.out.println(set);
        for (Iterator it = set.iterator(); it.hasNext();) {
            //输出数据
            System.out.println(it.next());
        }
    }
}
